{% extends "adminz/base.html" %}
{% block title %} {{ app_label }} | {{ model_name }} {% endblock %}
{% block extracss %} {% load static %}
<link rel="stylesheet" href="{% static 'bootstrap-table/1.23.5/bootstrap-table.min.css' %}">
{% endblock %}
{% block body %}
    {{ action_and_info | json_script:"container_for_action_and_info" }}
    {{ field_names | json_script:"container_for_field_names" }}
    <input type="hidden" id="csrf_token" value="{{ csrf_token }}">
    <div id="adminz_change_list_table_container">
        <div id="toolbar" class="d-flex gap-2 align-items-center">
            <div>
                {% include "adminz/change_list_action_option.html" %}
            </div>
            <div>
                <button class="btn btn-outline-primary" id="adminz_change_list_table_button_run_action" onclick="getSelectedRows( {{ field_names }} )">Run</button>
            </div>
        </div>
        <table id="adminz_change_list_table"
               data-toggle="table"
               data-toolbar="#toolbar"
               data-search="true"
               data-click-to-select="true"
        >
            <thead id="adminz_change_list_table_head">
                <tr id="adminz_change_list_table_head_row">
                    <th scope="col" data-checkbox="true" data-field="selected"></th>
                    {% for field_name in field_names %}
                        <th scope="col" data-field="{{ field_name }}">{{ field_name }}</th>
                    {% endfor %}
                </tr>
            </thead>
            <tbody>
                {% for values in values_list %}
                    <tr id="adminz_change_list_table_body_row">
                        <th scope="row"></th>
                        {% for value in values %}
                            <td>{{ value }}</td>
                        {% endfor %}
                    </tr>
                {% endfor %}
            </tbody>
        </table>
    <div>
    {% include "adminz/change_list_action_param.html" %}
{% endblock %}